home *** CD-ROM | disk | FTP | other *** search
/ The Macintosh Demo Applications CD / Apple-MacintoshDemoApplicationsCD-1.0-1992.bin / More Information / Personal Press 2.0 / PPPouch / AutoCreate / Newsletters / _CTMakePullQuotes / _CTMakePullQuotes next >
Text File  |  1992-06-08  |  8KB  |  2 lines

  1. on MakePullQuotes theDialogglobal vTimesSet mousecursor to busyprogressdialog show "Preparing Pullquote Dialog…"put 0 into TotalQuotes -- Total stories w/ pullquotesput "unknown" into TheResultrepeat with p = 1 to number of pagesset currentpage to pSet mousecursor to busyselect emptyselect objects where word 1 of name of this object = "PullQuote"put selectedobjects() into objsrepeat with q = 1 to number(items in objs)put item q of objs into oset itemdel to "\"-- Get the story that the pullquote is using.put word 2 of item 2 of name of object o into TheStoryNumset itemdel to ","-- Do we have more than one sentence?if (number of sentences in story theStoryNum) > 1 thenput TotalQuotes + 1 into TotalQuotes-- List of Story numbers.put TheStorynum into item TotalQuotes of ThePulledStoriesset itemdel to numtochar(1)-- List of current quotes.put sentence 1 of story TheStorynum into item TotalQuotes of TheQuotesset itemdel to ","-- List of quote objects ( Obj# \ Page, Obj# \ Page)put o & " \ " & p into item TotalQuotes of TheQuoteObjectsend ifend repeatend repeatprogressdialog hideif TotalQuotes = 0 then exit makePullQuotes put dialog(preload, 505) into theDialog-- Action proc for Pullquote Entry BoxSetDialogItem 11, "Box"-- Action proc for sentence nav box line.SetDialogItem 22, "Box"-- Action proc for break line box.SetDialogItem 14, "Box"-- Action proc for pullquote ProxieSetDialogItem 6, "Box"Set mousecursor to busy-- Tell user # of pullquotesput "This publication has x pullquote(s). Personal Press has selected" &&¬"the first sentence of this story for use as the pullquote. Verify that the pullquote" &&¬"is correct or type your own." into TheInstructionsput TotalQuotes into word 4 of TheInstructionsSetDialogItem 9, "text", TheInstructions-- Do every story in the pub.put 1 into CurrentQuoteNumput 1 into CurrentSentenceset itemdel to numtochar(1)put item CurrentQuoteNum of theQuotes into TheQuoteTextset itemdel to ","SetDialogItem 10, "Set", "Contents",TheQuoteTextrepeat foreverput item CurrentQuoteNum of TheQuoteObjects into CurrentQuoteObjectset itemdel to "\"set currentpage to item 2 of CurrentQuoteObjectset itemdel to ","set itemdel to numtochar(1)put item CurrentQuoteNum of theQuotes into TheQuoteTextset itemdel to ","-- Check to see if we are to use user input, or slider input for sentence content.if ContentsOf(item10) ≠ theQuoteText thenput ContentsOf(item10) into theQuoteTextset itemdel to numtochar(1)put theQuoteText into item CurrentQuoteNum of theQuotesset itemdel to ","end if-- Set sentence 1 of story in the pullquote entry dialog box.SetDialogItem 10, "Set", "Contents", ¬theQuoteText -- Set name of story in the pullquote "story" box.SetDialogItem 16,  "Contents", quote & ¬username of story (item CurrentQuoteNum of ThePulledStories) & quote-- Set Max number of sentences.put number of sentences in story (item CurrentQuoteNum of thePulledStories)¬into MaxSentences-- Set slider valuesSetDialogItem 19, "contents", "1," & CurrentSentence &"," & MaxSentences-- Set current sentence boxSetDialogItem 25, "contents", CurrentSentence-- Set status of prev & next buttons.if (CurrentQuoteNum = TotalQuotes) and (TotalQuotes > 1) thenSetDialogItem 3,"Disabled" -- Next quote.SetDialogItem 4,"Enabled" -- Prev quote.end ifif (CurrentQuoteNum = 1) and (TotalQuotes > 1) thenSetDialogItem 3,"Enabled" -- Next quote.SetDialogItem 4,"Disabled" -- Prev quote.end ifif (CurrentQuoteNum ≠ 1) and (TotalQuotes > 1)¬and (CurrentQuoteNum ≠ TotalQuotes) thenSetDialogItem 3,"Enabled" -- Next quote.SetDialogItem 4,"Enabled" -- Prev quote.end ifif (TotalQuotes = 1) thenSetDialogItem 3,"Disabled" -- Next quote.SetDialogItem 4,"Disabled" -- Prev quote.end if-- Handle the dialog.select text sentence CurrentSentence of story¬(item CurrentQuoteNum of thePulledStories)put textcursor into lastselectionrepeat foreverget dialog(display, theDialog) switch itcase 26 -- Next Buttonput "Next" into theResultput ContentsOf(item10) into TempHoldset itemdel to numtochar(1)put TempHold into item CurrentQuoteNum of TheQuotesset itemdel to ","exit repeatexit switchcase 3 -- Next Headlineput ContentsOf(item10) into TempHoldset itemdel to numtochar(1)put TempHold into item CurrentQuoteNum of TheQuotesset itemdel to ","put 1+CurrentQuoteNum into CurrentQuoteNumif CurrentQuoteNum > TotalQuotes then put TotalQuotes into CurrentQuoteNumexit repeatexit switchcase 4 -- Prev Headlineput ContentsOf(item10) into TempHoldset itemdel to numtochar(1)put TempHold into item CurrentQuoteNum of TheQuotesset itemdel to ","put CurrentQuoteNum - 1 into CurrentQuoteNumif CurrentQuoteNum < 1 then put 1 into CurrentQuoteNum SetDialogItem 25, "Contents", CurrentSentenceexit repeatexit switchcase 21 -- Prev sentence.put CurrentSentence - 1 into CurrentSentenceif CurrentSentence < 1 then put 1 into CurrentSentenceSetDialogItem 25, "Contents", CurrentSentence-- Get the sentence of the storyselect text char item 1 of lastselection to item 2 of lastselection of story¬(item CurrentQuoteNum of thePulledStories)select previous text sentenceset itemdel to numtochar(1)put textSelection into item currentQuoteNum of theQuotesset itemdel to ","put textcursor into lastselectionchoose maintoolset itemdel to numtochar(1)put item CurrentQuoteNum of theQuotes into TheQuoteTextset itemdel to ","SetDialogItem 10, "Set", "Contents", ¬TheQuoteTextexit repeatexit switchcase 20 -- Next Sentence.put currentSentence + 1 into CurrentSentenceif CurrentSentence > MaxSentences then put MaxSentences into CurrentSentenceSetDialogItem 25, "Contents", CurrentSentence-- Get the sentence of the storyselect text char item 1 of lastselection to item 2 of lastselection of story¬(item CurrentQuoteNum of thePulledStories)select next text sentenceset itemdel to numtochar(1)put textSelection into item currentQuoteNum of theQuotesset itemdel to ","put textcursor into lastselectionchoose maintoolset itemdel to numtochar(1)put item CurrentQuoteNum of theQuotes into TheQuoteTextset itemdel to ","SetDialogItem 10, "Set", "Contents", ¬TheQuoteTextexit repeatexit switchcase 26 -- This Sentence button.case 19 -- Sentence sliderput item 2 of ContentsOf(item19) into currentSentenceSetDialogItem 25, "Contents", CurrentSentence-- Get the sentence of the storychoose maintoolput item CurrentQuoteNum of thePulledStories into stynumset itemdel to numtochar(1)put sentence CurrentSentence of story stynum ¬into item currentQuoteNum of theQuotesput item CurrentQuoteNum of theQuotes into TheQuoteTextset itemdel to ","SetDialogItem 10, "Set", "Contents", ¬TheQuoteTextexit repeatexit switchcase 5 helpdialog 505, "AutoCreate - Pullquote Editor"SetDialogItem 9, "text", TheInstructionsexit switchend switch end repeat -- Dialog Handler.Set mousecursor to busyif TheResult = "Next" then repeat with x = 1 to TotalQuotes-- Get the quote.set itemdel to numtochar(1)put item x of TheQuotes into TheCurrentQuoteset itemdel to ","-- Get the quote object.put item x of TheQuoteObjects into TheCurrentQuoteObjset itemdel to "\"set currentpage to item 2 of TheCurrentQuoteObjset itemdel to ","put item 1 of storyloc of object (word 1 of TheCurrentQuoteObj)¬into TheQuoteStoryselect all text in story TheQuoteStoryset styleRecomposition to falseput TheCurrentQuote into story TheQuoteStoryselect all text in story TheQuoteStoryset textFont to vTimesset textsize to 10set textface to plainset textface to italicset RulerJustification to centerset RulerHyphenation to falseset flexibleParaSpace to falseset flexibleLeading to trueSet flexibleCharSize to trueset styleRecomposition to trueSet mousecursor to busyend repeatset currentpage to 1exit repeat -- Jump out 'cause were done!end ifend repeat -- Caption Count.put dialog(dispose, thedialog) into theresultSet mousecursor to busyend MakePullQuotes     #û
  2. „<BÏ